package models

import (
	"time"
)

// BaseModel 所有实体类的基类
type BaseModel struct {
	CreatedAt time.Time `gorm:"type:datetime; NULL;"`
	CreatedBy string    `gorm:"type:varchar(255); NULL;"`
	UpdatedAt time.Time `gorm:"type:datetime; NULL;"`
	UpdatedBy string    `gorm:"type:varchar(255); NULL;"`
	// 定义成指针就行 *time.Time，然后数据库字段允许为 null。这样在未赋值的情况下，插入的就是 null 了
	DeletedAt *time.Time `gorm:"type:datetime; NULL;"`
	DeletedBy string     `gorm:"type:varchar(255); NULL;"`
}
